package com.ruoyi.hr.controller.hr.empInfo;

import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.page.TableDataInfo;
import com.ruoyi.hr.service.empinfo.BackGroundInfoService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.ModelMap;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

/**
 * @author zeo
 * @explain 员工背景信息
 * @date 2020/4/2 10:23
 */
@Controller
@RequestMapping("/empInfo/backGroundInfo")
public class BackGroundInfoController extends BaseController{

    @Autowired
    BackGroundInfoService backGroundInfoService;

    private String prefix = "hr/empinfo/backgroundinfo";

    /**
     * 跳转分页页面
     */
    @GetMapping()
    public String backGroundInfo(String eid, ModelMap mmap) {
        mmap.put("eid", eid);
        mmap.put("personal", backGroundInfoService.findPersonalInfo(eid));
        return prefix + "/backGroundInfo";
    }

    @RequestMapping("/getEducationList")
    @ResponseBody
    public TableDataInfo getEducationList(String eid){
        startPage();
        return getDataTable(backGroundInfoService.getEducationList(eid));
    }

    @RequestMapping("/getWorkList")
    @ResponseBody
    public TableDataInfo getWorkList(String eid){
        startPage();
        return getDataTable(backGroundInfoService.getWorkList(eid));
    }

    @RequestMapping("/getTitleList")
    @ResponseBody
    public TableDataInfo getTitleList(String eid){
        startPage();
        return getDataTable(backGroundInfoService.getTitleList(eid));
    }

    @RequestMapping("/getTrainingList")
    @ResponseBody
    public TableDataInfo getTrainingList(String eid){
        startPage();
        return getDataTable(backGroundInfoService.getTrainingList(eid));
    }

    @RequestMapping("/getProjectList")
    @ResponseBody
    public TableDataInfo getProjectList(String eid){
        startPage();
        return getDataTable(backGroundInfoService.getProjectList(eid));
    }

    @RequestMapping("/getHortationList")
    @ResponseBody
    public TableDataInfo getHortationList(String eid){
        startPage();
        return getDataTable(backGroundInfoService.getHortationList(eid));
    }

    @RequestMapping("/getFamilyList")
    @ResponseBody
    public TableDataInfo getFamilyList(String eid){
        startPage();
        return getDataTable(backGroundInfoService.getFamilyList(eid));
    }

    @RequestMapping("/getEmergencyList")
    @ResponseBody
    public TableDataInfo getEmergencyList(String eid){
        startPage();
        return getDataTable(backGroundInfoService.getEmergencyList(eid));
    }

    @RequestMapping("/getLanguageList")
    @ResponseBody
    public TableDataInfo getLanguageList(String eid){
        startPage();
        return getDataTable(backGroundInfoService.getLanguageList(eid));
    }

    @RequestMapping("/getCertificateList")
    @ResponseBody
    public TableDataInfo getCertificateList(String eid){
        startPage();
        return getDataTable(backGroundInfoService.getCertificateList(eid));
    }
}

